﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RoboticOperationMerge.CCoROMRoboticOperationMergeCmdEnabler
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.RoboticOperationMerge;

public class CCoROMRoboticOperationMergeCmdEnabler : ITxCommandEnabler
{
  private bool m_manualDisable;

  public CCoROMRoboticOperationMergeCmdEnabler() => this.m_manualDisable = false;

  public virtual bool Enable => !this.m_manualDisable && this.IsSelectionValid();

  private bool IsSelectionValid()
  {
    bool flag = true;
    TxObjectList allItems = TxApplication.ActiveSelection.GetAllItems();
    if (((Collection<ITxObject>) allItems).Count == 1)
      flag = ((Collection<ITxObject>) allItems)[0].CanBeModified;
    return flag;
  }

  public bool ManualDisable
  {
    get => this.m_manualDisable;
    set => this.m_manualDisable = value;
  }
}
